<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<title>流程图形化显示</title>
		<meta http-equiv="Content-Type" content="text/html"/>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
		<link rel="stylesheet" href="/HTOA/js/dojo191/dojo/resources/dojo.css">
		<link rel="stylesheet" href="/HTOA/js/dojo191/dijit/themes/soria/soria.css" />
		<style type='text/css'>
			.dvAllIdea{
				float:left;margin:2px 2px;
			}
			.dvCurr{
				background-color:lightblue
			}
			.dvAllIdea table{
				width:150px;border:1px solid #888;font-size:14px
			}
			.dvAllIdea table tr{
				height:30px;
			}
			.dvAllIdea table td{
				border:1px solid #888;
			}
			.tdLogtache{
				font-weight:bold;text-indent:5px;background-color:#ffc
			}
			.tdLogidea{
				padding:2px;padding-left:5px;line-height:20px
			}
			.tdLogname{
				padding-left:80px;letter-spacing:5px
			}
			.tdLogtime{
				text-align:right;padding-right:2px
			}
		</style>
		<script src="/HTOA/js/dojo191/dojo/dojo.js" type='text/javascript' djConfig="parseOnLoad:true"></script>
		<script>
			var BasePath="/HTOA/js/workflow",gWFGraphXML='',gWFFlowLogXML='${baseEntity.wfFlowLogXml }',gWFCurNodeID=[''],gWFRouterID="N2; N4",gWFStatus=2,gCurUser="",gWFStatus="",gWFTacheName="流程结束";
			dojo.require("dojox/xml/parser");
			dojo.addOnLoad(function(){
				var sTacheNum=1,DataPrefix=DataSuffix=strId=WFIdeaPrefix=WFIdeaSuffix="";
				var gWFLogXML=dojox.xml.parser.parse(gWFFlowLogXML.replace(/\r|\n/g,""));
				var tmpCurUser=gCurUser.replace(/\s/g,""),arrTmpCurUser=tmpCurUser.indexOf(",")>-1?tmpCurUser.split(","):tmpCurUser.split(";");
				gWFLogXML=gWFLogXML.documentElement;
				dojo.forEach(gWFLogXML.childNodes,function(item){
					var _action=item.getAttribute("action");
					DataPrefix='<table cellspacing=1 cellpadding=1><tr><td class="tdLogtache">'+"("+sTacheNum+")&nbsp;"+item.getAttribute("tache")+'</td></tr>';
					DataSuffix='<tr><td class="tdLogname">'+item.getAttribute("user").replace(/[0-9]/g,"")+'</td></tr><tr><td class="tdLogtime">'+item.getAttribute("time")+'</td></tr><tr><td class="tdLogtime" title="'+_action+'" nowrap=true>'+(_action.length>15?_action.substr(0,15)+"...":_action)+'</td></tr></table>';
					dojo.addClass(dojo.create("div",{innerHTML:DataPrefix+DataSuffix},"WFInfo","last"),"dvAllIdea");
					sTacheNum++;
				});
				DataPrefix='<table cellspacing=1 cellpadding=1><tr><td class="tdLogtache">('+sTacheNum+')&nbsp;当前环节名称</td></tr>';
				DataPrefix+='<tr><td class="tdLogTime">'+gWFTacheName+'</td></tr>';
				if(gWFStatus<2){
					DataPrefix+='<tr><td class="tdLogtache">相关处理人</td></tr>';
					DataPrefix+='<tr><td class="tdLogTime" nowrap=true title="'+arrTmpCurUser.join(";")+'">'+arrTmpCurUser.slice(0,5).join(";")+(arrTmpCurUser.length<6?'':'...')+'</td></tr></table>';
				}else{
					DataPrefix="<table cellspacing=1 cellpadding=1><tr><td class='tdLogtache'>流程已结束</td></tr></table>";
				}
				dojo.addClass(dojo.create("div",{innerHTML:DataPrefix},"WFInfo","last"),"dvAllIdea dvCurr");
			});
		</script>
		<script src="/HTOA/js/workflow/js/Client-mini.js" type='text/javascript'></script>
		<script type="text/javascript" src="/HTOA/js/workflow/js/showApplication.js"></script>
	</head>
	<body class='soria' onload="Application('/HTOA/js/workflow/config/graph-show.xml')" oncontextmenu="return true" onselectstart="return false">
		<div data-dojo-type="dijit/layout/TabContainer" style="width: width: 800px; height: 560px">
			<div data-dojo-type="dijit/layout/ContentPane" title="流程图" data-dojo-props="selected:true">
				<div style="width:100px;height:550px;float:left;text-align:center;line-height:500px;">
					<IMG src="/HTOA/js/workflow/images/picLegend.png">
				</div>
				<div  style="width:730px;height:550px;overflow:auto;float:left;">
					<textarea id="WFGraphXML" style="display:none">
						${baseEntity.wfGraphXml }
					</textarea>
					<div id="graph" style="width:100%;height:100%"></div>
					<textarea style="display:none" value="" id="GraphXML"></textarea>
				</div>
			</div>
			<div data-dojo-type="dijit/layout/ContentPane" title="流程信息">
				<div id='WFInfo' style="width:860px;height:550px;overflow:scroll;float:left;">
				</div>
			</div>
		</div>
	</body>
</html>
